package wzc.design_pattern.construction.composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class Team implements Employee{
    private String name;
    private List<Employee> members = new ArrayList<>();

    public Team(String name) {
        this.name = name;
    }

    public void addMember(Employee member) {
        members.add(member);
    }

    public void removeMember(Employee member) {
        members.remove(member);
    }

    @Override
    public void showDetails() {
        System.out.println("---------团队：" + name + " ----------");
        members.forEach(Employee::showDetails);
    }
}
